package com.example.daxiguaforharmony.game.system;

import com.example.daxiguaforharmony.game.Fruits;
import com.example.daxiguaforharmony.game.GameData;
import com.example.daxiguaforharmony.game.GameScene;
import com.example.daxiguaforharmony.game.core.featrue.IReactiveSystem;

public class UseEyeSystem implements IReactiveSystem {
    private GameScene _scene = null;
    public boolean enabled = true;
    public UseEyeSystem(GameScene scene) {
        this._scene = scene;
    }

    @Override
    public boolean Filter(String type) {
        return this.enabled && type == GameScene.Event.USE_EYE_ITEM;
    }

    @Override
    public void Execute(String type, Object arg1, Object arg2, Object arg3, Object arg4, Object arg5) {
        GameData gameData = this._scene.gameData;
        gameData.addItemNum(GameScene.ItemID.ITEM1, -1);
        this._scene.addPreviewTimes(5);
        this._scene.AddEvent(GameScene.Event.USE_ITEM, GameScene.ItemID.ITEM1, 1, null, null);
    }

    @Override
    public void Destory() {}
}
